#include "CDeselectCommand.h"
#include "CLevelEditor.h"
#include "CSceneObject.h"

extern CLevelEditor* editor;

CDeselectCommand::CDeselectCommand (array<int> oldIds)
{
	m_ids = oldIds;
}

void CDeselectCommand::redo ()
{
	editor->setSelectedNode(0);
}

void CDeselectCommand::undo ()
{
	editor->setSelectedNode(editor->getSceneObjectFromID(m_ids[0])->m_SceneNode);
	editor->m_selection.clear();
	for (u32 i = 0; i < m_ids.size(); ++i)
	{
		editor->m_selection.push_back(editor->getSceneObjectFromID(m_ids[i]));
	}
}
